<?php 
/**************************************************
 *  MeatBallBot Web-Interface v0.4a               *
 *                                                *
 *  Licenced under the GPLv3                      *
 *                                                *
 *  Originally coded by HttpError (Jordan Songer) *
 **************************************************/ 
include("../inc/include.php");

//checks cookies to make sure they are logged in 
if(isset($_COOKIE['ID_my_site'])) 
{ 
  $user = $_COOKIE['ID_my_site']; 
  $pass = $_COOKIE['Key_my_site']; 
  $check = mysql_query("SELECT * FROM users WHERE user = '$user'")or die(mysql_error()); 
  while($info = mysql_fetch_array( $check )) 
  { 

    //if the cookie has the wrong password, they are taken to the login page 
    if ($pass != $info['password']) 
    { 
      header("Location: ../index.php"); 
    } 
    else 
    {
      $res = mysql_query("SELECT * FROM `channels`");
      while($resarr = mysql_fetch_array($res))
      {
        $chanarr[] = $res;
    }
    echo "<pre>\n".print_r($chanarr)."\n</pre>";
  }
} else { header("Location: ../index.php"); }
?>
